package com.mayajie.tree;

/**
 * 树的存储结构-孩子兄弟链表
 * @author mayajie
 * @date 2021/10/29
 */
public class ChildBrotherChainStruct {
    class Node{
        Node child;
        Object data;
        Node brother;

        public Node(Node child, Object data, Node brother) {
            this.child = child;
            this.data = data;
            this.brother = brother;
        }
    }

    public Node create() {
        Node tree = new Node(new Node(new Node(null, 'B', new Node(new Node(null, 'G', new Node(null, 'F', new Node(null, 'D', null))), 'E', null)), 'A', new Node(null, 'C', null)), 'H', null);
        return tree;
    }

    public static void main(String[] args) {
        new ChildBrotherChainStruct().create();
    }

}
